package com.one.group.enums;


/**
 * @author Cherry
 */
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录或登录已失效"),
    LOGIN_EXPIRED_ERROR(40100, "登陆失效"),
    NO_AUTH_ERROR(40101, "无权限"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    ADD_ERROR(50002, "添加失败"),
    DELETE_ERROR(50003, "删除失败"),
    UPDATE_ERROR(50004, "更新失败"),
    USER_NOT_EXIST(40401, "用户不存在"),
    NOT_ILLEGAL_ERROR(40301, "TOKEN不合法"),
    Code_NOT_EXIST(40402, "验证码错误"),
    Data_CODE_EXITS(40001, "数据已存在");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
